#include<stdio.h>
int main() {
 int p[11][11];
 int i,j,k;

 for(i=1;i<=10;i++) {
     for(k=i;k<=10;k++) { /*creating whitespaces*/
         printf("  ");
     }
     for(j=1;j<=i;j++) {
        if(j==1 || i==j) { /*printing the boundary elements i.e. 1*/
            p[i][j]=1;
            printf("%3d ",p[i][j]);
        }
        else { /*printing the rest elements*/
            p[i][j]=p[i-1][j-1]+p[i-1][j];
            printf("%3d ",p[i][j]);
        }}
      printf("\n");
   }}
